* Wealth index calculation. Amadou SOW, 10/24/2023. Sengal DHS 2022-23. * cd 'C:\SN81\Wealth'. cd 'C:\Users\21180\OneDrive - ICF\Projects\Analysis\Wealth Index Construction\SN2023\Wealth '. include file='wealth_assets.sps'. missing values QH131 (99.9). execute. set tvars=both. * Macro definitions to perform some recoding automatically. * Note: Do not use an asterisk in front of a macro name to try to comment it out - it will run any way because of the way the macros are expanded. * Delete the line instead or change the spelling of the macro in the comment. * Do not use the names of macros in comments - they will also be expanded too, and likely will fail. *{Create binary variables based on condition and give label }. define dichotomize( !positional !enclose('(',')') / !positional !tokens(1) / !positional !tokens(1) ) compute !2=0. if (!1) !2=1. variable labels !2 !3. value labels !2 0 'No' 1 'Yes'. formats !2 (f1.0). !enddefine. *(Separate shared toilets from non-shared toilets). define shared_fac( !positional !tokens(1) / !positional !tokens(1) / !positional !tokens(1) ). compute !2 = 0. do if (QH110=1). + if (!1=1) !2 = 1. + compute !1 = 0. end if. variable labels !2 !3. value labels !2 0 'No' 1 'Yes'. formats !2 (f1.0). !enddefine. *{Reset missing values to 'does not have', change 2 code to 0}. define no2zero( !positional !tokens(1) ) if (missing(!1) | !1<>1) !1=0. value labels !1 0 'No' 1 'Yes'. !enddefine. *{Construct Variables}. * Staut d'occupation du logement. dichotomize (QH101A=1) QH101A_1 "Statut d'occupation du logement: Proprietaire". dichotomize (QH101A=2) QH101A_2 "Statut d'occupation du logement: Copropriétaire". dichotomize (QH101A=3) QH101A_3 "Statut d'occupation du logement: Locataire - acheteur". dichotomize (QH101A=4) QH101A_4 "Statut d'occupation du logement: Locataire simple". dichotomize (QH101A=5) QH101A_5 "Statut d'occupation du logement: Colocataire". dichotomize (QH101A=6) QH101A_6 "Statut d'occupation du logement: Sous - locataire". dichotomize (QH101A=7) QH101A_7 "Statut d'occupation du logement: Logé par l'employeur". dichotomize (QH101A=8) QH101A_8 "Statut d'occupation du logement: Logé gratuitement par un parent ou ami". * Source d'eau potable. dichotomize (QH101=11) QH101_11 "Source d'eau potable: Eau du robinet dans le logement". dichotomize (QH101=12) QH101_12 "Source d'eau potable: Eau du robinet dans la cour/concession". dichotomize (QH101=13) QH101_13 "Source d'eau potable: Robinet chez les voisins". dichotomize (QH101=14) QH101_14 "Source d'eau potable: Eau du robinet public/borne fontaine". dichotomize (QH101=21) QH101_21 "Source d'eau potable: Puits à pompe ou forage". dichotomize (QH101=31) QH101_31 "Source d'eau potable: Puits protégés". dichotomize (QH101=32) QH101_32 "Source d'eau potable: Puits non protégés". dichotomize (QH101=41) QH101_41 "Source d'eau potable: Source protégée". dichotomize (QH101=42) QH101_42 "Source d'eau potable: Source non protégée". dichotomize (QH101=51) QH101_51 "Source d'eau potable: Eau de pluie". dichotomize (QH101=61) QH101_61 "Source d'eau potable: Camion citerne". dichotomize (QH101=71) QH101_71 "Source d'eau potable: Charrette avec petite citerne / Tonneau". dichotomize (QH101=81) QH101_81 "Source d'eau potable: Eau de surface (rivière/barrages/lacs/mares/fleuves/Canal/Canal d'irrigation)". dichotomize (QH101=91) QH101_91 "Source d'eau potable: Eau en bouteille/ sachet industrialisé". dichotomize (QH101=92) QH101_92 "Source d'eau potable: Eau en sachet". *ichotomize (QH101=96) QH101_96 "Source d'eau potable: Autre". * Type de toilettes. dichotomize (QH109=11) QH109_11 "Type de toilettes: Chasse d'eau connectée un système d'égout". dichotomize (QH109=12) QH109_12 "Type de toilettes: Chasse d'eau connectée à une fosse septique". dichotomize (QH109=13) QH109_13 "Type de toilettes: Chasse d'eau connectée a une fosse d'aisance". dichotomize (QH109=14) QH109_14 "Type de toilettes: Chasse d'eau connectée a quelque chose d'autre". *ichotomize (QH109=15) QH109_15 "Type de toilettes: Ne sait pas ou". dichotomize (QH109=21) QH109_21 "Type de toilettes: Fosses d'aisance améliorée auto-aérée". dichotomize (QH109=22) QH109_22 "Type de toilettes: Fosse d'aisance avec dalle". dichotomize (QH109=23) QH109_23 "Type de toilettes: Fosse d aisance sans dalle/ trou ouvert". dichotomize (QH109=31) QH109_31 "Type de toilettes: Toilette a compostage". dichotomize (QH109=41) QH109_41 "Type de toilettes: Seau/ tinette". dichotomize (QH109=51) QH109_51 "Type de toilettes: Toilettes/ tatrines suspendus". dichotomize (QH109=61) QH109_61 "Type de toilettes: Pas de toilette nature". dichotomize (QH109=96) QH109_96 "Type de toilettes: Autre". shared_fac QH109_11 QH109_11_sh "Type de toilettes: Chasse d'eau connectée un système d'égout - shared". shared_fac QH109_12 QH109_12_sh "Type de toilettes: Chasse d'eau connectée à une fosse septique - shared". shared_fac QH109_13 QH109_13_sh "Type de toilettes: Chasse d'eau connectée a une fosse d'aisance - shared". shared_fac QH109_14 QH109_14_sh "Type de toilettes: Chasse d'eau connectée a quelque chose d'autre - shared". *hared_fac QH109_15 QH109_15_sh "Type de toilettes: Ne sait pas ou - shared". shared_fac QH109_21 QH109_21_sh "Type de toilettes: Fosses d'aisance améliorée auto-aérée - shared". shared_fac QH109_22 QH109_22_sh "Type de toilettes: Fosse d'aisance avec dalle - shared". shared_fac QH109_23 QH109_23_sh "Type de toilettes: Fosse d aisance sans dalle/ trou ouvert - shared". shared_fac QH109_31 QH109_31_sh "Type de toilettes: Toilette a compostage - shared". *hared_fac QH109_41 QH109_41_sh "Type de toilettes: Seau/ tinette - shared". shared_fac QH109_51 QH109_51_sh "Type de toilettes: Toilettes/ tatrines suspendus - shared". shared_fac QH109_96 QH109_96_sh "Type de toilettes: Autre - shared". * Type de cuisinière. dichotomize (QH117=1) QH117_1 "Type de cuisinière: Cuisinière électrique". dichotomize (QH117=2) QH117_2 "Type de cuisinière: Four solaire". dichotomize (QH117=3) QH117_3 "Type de cuisinière: Cuisinière à gaz propane liquéfié (GPL)/Cuisinière à gaz". dichotomize (QH117=4) QH117_4 "Type de cuisinière: Cuinière connectée au gaz naturel". dichotomize (QH117=5) QH117_5 "Type de cuisinière: Cuisinière au biogaz". dichotomize (QH117=6) QH117_6 "Type de cuisinière: Cuisinière à combustible liquide". dichotomize (QH117=7) QH117_7 "Type de cuisinière: Cuisinière d'un fabricant à combustible solide". dichotomize (QH117=8) QH117_8 "Type de cuisinière: Cuisinière traditionnelle à combustible solide". dichotomize (QH117=9) QH117_9 "Type de cuisinière: Foyer à trois pierres/foyer ouvert". dichotomize (QH117=95) QH117_95 "Type de cuisinière: Pas de repas préparé dans le ménage". dichotomize (QH117=96) QH117_96 "Type de cuisinière: Autre à preciser". * Type de combustible. dichotomize (QH120=1) QH120_1 "Type de combustible: Alcool/éthanol". dichotomize (QH120=2) QH120_2 "Type de combustible: Essence/diesel". dichotomize (QH120=3) QH120_3 "Type de combustible: Paraffine/pétrole". dichotomize (QH120=4) QH120_4 "Type de combustible: Charbon/lignite". dichotomize (QH120=5) QH120_5 "Type de combustible: Charbon de bois". dichotomize (QH120=6) QH120_6 "Type de combustible: Bois". dichotomize (QH120=7) QH120_7 "Type de combustible: Paille/branchages/herbes". dichotomize (QH120=8) QH120_8 "Type de combustible: Produits agricoles". dichotomize (QH120=9) QH120_9 "Type de combustible: Bouse d'animal/déchets". dichotomize (QH120=10) QH120_10 "Type de combustible: Combustibles biomasse transformés (Pellets) ou granulés de bois". *ichotomize (QH120=11) QH120_11 "Type de combustible: Ordures/plastique". dichotomize (QH120=12) QH120_12 "Type de combustible: Sciure". dichotomize (QH120=11 | QH120=96) QH120_96 "Type de combustible: Autre, Ordures/plastique". * Source de chauffage pour la maison. *ichotomize (QH123=1) QH123_1 "Source de chauffage pour la maison: Chauffage central". dichotomize (QH123=2) QH123_2 "Source de chauffage pour la maison: Radiateur d'un fabricant". dichotomize (QH123=3) QH123_3 "Source de chauffage pour la maison: Radiateur traditionnel". dichotomize (QH123=4) QH123_4 "Source de chauffage pour la maison: Fourneau d'un fabricant". dichotomize (QH123=5) QH123_5 "Source de chauffage pour la maison: Fourneau traditionnel". dichotomize (QH123=6) QH123_6 "Source de chauffage pour la maison: Feu à trois pierres/foyer ouvert". dichotomize (QH123=95) QH123_95 "Source de chauffage pour la maison: Pas chauffage/radiateur dans ménage". dichotomize (QH123=1 | QH123=96) QH123_96 "Source de chauffage pour la maison: Autre,Chauffage central". * Type de combustible pour le chauffage. dichotomize (QH125=1) QH125_1 "Type de combustible pour le chauffage: Électricité". dichotomize (QH125=2) QH125_2 "Type de combustible pour le chauffage: Connecté au gaz naturel". *ichotomize (QH125=3) QH125_3 "Type de combustible pour le chauffage: Chauffage solaire de l'air". dichotomize (QH125=4) QH125_4 "Type de combustible pour le chauffage: Gaz propane liquéfié (gpl)/gaz de cuisine". dichotomize (QH125=5) QH125_5 "Type de combustible pour le chauffage: Biogaz". *ichotomize (QH125=6) QH125_6 "Type de combustible pour le chauffage: Alcool/éthanol". *ichotomize (QH125=7) QH125_7 "Type de combustible pour le chauffage: Essence/diesel". *ichotomize (QH125=8) QH125_8 "Type de combustible pour le chauffage: Paraffine/pétrole". dichotomize (QH125=9) QH125_9 "Type de combustible pour le chauffage: Charbon/lignite". dichotomize (QH125=10) QH125_10 "Type de combustible pour le chauffage: Charbon de bois". dichotomize (QH125=11) QH125_11 "Type de combustible pour le chauffage: Bois". *ichotomize (QH125=12) QH125_12 "Type de combustible pour le chauffage: Paille/branchages/herbes". dichotomize (QH125=12 | QH125=13) QH125_13 "Type de combustible pour le chauffage: Produits agricoles, Paille/branchages/herbes". dichotomize (QH125=14) QH125_14 "Type de combustible pour le chauffage: Bouse d'animal/déchets". *ichotomize (QH125=15) QH125_15 "Type de combustible pour le chauffage: Combustibles biomasse transformés( pellets) ou granulés de bois". *ichotomize (QH125=16) QH125_16 "Type de combustible pour le chauffage: Ordures/plastique". *ichotomize (QH125=17) QH125_17 "Type de combustible pour le chauffage: Sciure". dichotomize (QH125=3 | QH125=8 | QH125=16 | QH125=17 | QH125=96) QH125_96 "Type de combustible pour le chauffage: Autre". * Type d'éclairage à la maison. dichotomize (QH126=1) QH126_1 "Type d'éclairage à la maison: Électricité (SENELEC)". dichotomize (QH126=2) QH126_2 "Type d'éclairage à la maison: Groupe electrogene". dichotomize (QH126=3) QH126_3 "Type d'éclairage à la maison: Solaire". dichotomize (QH126=4) QH126_4 "Type d'éclairage à la maison: Lampe torche". *ichotomize (QH126=5) QH126_5 "Type d'éclairage à la maison: Lampe à gaz". dichotomize (QH126=5 | QH126=6 | QH126=7) QH126_6 "Type d'éclairage à la maison: Lampe tempete, à gaz, à petrole artisanale". *ichotomize (QH126=7) QH126_7 "Type d'éclairage à la maison: Lampe à petrole artisanale". dichotomize (QH126=8) QH126_8 "Type d'éclairage à la maison: Bougie". dichotomize (QH126=9) QH126_9 "Type d'éclairage à la maison: Bois". dichotomize (QH126=95) QH126_95 "Type d'éclairage à la maison: Pas d'éclairage dans le ménage". dichotomize (QH126=96) QH126_96 "Type d'éclairage à la maison: Autre à preciser". * Vaches laitières ou taureaux. if (missing(QH129A) | QH128 <> 1) QH129A=0. missing values QH129A (99). compute QH129A_1 = (QH129A >= 1 & QH129A <= 4). compute QH129A_2 = (QH129A >= 5 & QH129A <= 9). compute QH129A_3 = (QH129A >= 10 & QH129A <= 98). variable labels QH129A_1 'Vaches laitières ou taureaux: 1-4' /QH129A_2 'Vaches laitières ou taureaux: 5-9' /QH129A_3 'Vaches laitières ou taureaux: 10+'. * Chameaux. if (missing(QH129B) | QH128 <> 1) QH129B=0. missing values QH129B (99). compute QH129B_1 = (QH129B >= 1 & QH129B <= 98). *ompute QH129B_2 = (QH129B >= 5 & QH129B <= 98). *ompute QH129B_3 = (QH129B >= 10 & QH129B <= 98). variable labels QH129B_1 'Chameaux: 1+'. * Chevaux, ânes ou mulets. if (missing(QH129C) | QH128 <> 1) QH129C=0. missing values QH129C (99). compute QH129C_1 = (QH129C >= 1 & QH129C <= 4). compute QH129C_2 = (QH129C >= 5 & QH129C <= 9). compute QH129C_3 = (QH129C >= 10 & QH129C <= 98). variable labels QH129C_1 'Chevaux, ânes ou mulets: 1-4' /QH129C_2 'Chevaux, ânes ou mulets: 5-9' /QH129C_3 'Chevaux, ânes ou mulets: 10+'. * Chèvres. if (missing(QH129D) | QH128 <> 1) QH129D=0. missing values QH129D (99). compute QH129D_1 = (QH129D >= 1 & QH129D <= 4). compute QH129D_2 = (QH129D >= 5 & QH129D <= 9). compute QH129D_3 = (QH129D >= 10 & QH129D <= 98). variable labels QH129D_1 'Chèvres: 1-4' /QH129D_2 'Chèvres: 5-9' /QH129D_3 'Chèvres: 10+'. * Moutons. if (missing(QH129E) | QH128 <> 1) QH129E=0. missing values QH129E (99). compute QH129E_1 = (QH129E >= 1 & QH129E <= 4). compute QH129E_2 = (QH129E >= 5 & QH129E <= 9). compute QH129E_3 = (QH129E >= 10 & QH129E <= 98). variable labels QH129E_1 'Moutons: 1-4' /QH129E_2 'Moutons: 5-9' /QH129E_3 'Moutons: 10+'. * Poulets ou autre volaille. if (missing(QH129F) | QH128 <> 1) QH129F=0. missing values QH129F (99). compute QH129F_1 = (QH129F >= 1 & QH129F <= 9). compute QH129F_2 = (QH129F >= 10 & QH129F <= 29). compute QH129F_3 = (QH129F >= 30 & QH129F <= 98). variable labels QH129F_1 'Poulets ou autre volaille: 1-9' /QH129F_2 'Poulets ou autre volaille: 10-29' /QH129F_3 'Poulets ou autre volaille: 30+'. * Porcs. if (missing(QH129G) | QH128 <> 1) QH129G=0. missing values QH129G (99). compute QH129G_1 = (QH129G >= 1 & QH129G <= 4). compute QH129G_2 = (QH129G >= 5 & QH129G <= 9). compute QH129G_3 = (QH129G >= 10 & QH129G <= 98). variable labels QH129G_1 'Porcs: 1-4' /QH129G_2 'Porcs: 5-9' /QH129G_3 'Porcs: 10+'. * Autre betail. if (missing(QH129H) | QH128 <> 1) QH129H=0. missing values QH129H (99). compute QH129H_1 = (QH129H >= 1 & QH129H <= 4). compute QH129H_2 = (QH129H >= 5 & QH129H <= 9). compute QH129H_3 = (QH129H >= 10 & QH129H <= 98). variable labels QH129H_1 'Autre betail: 1-4' /QH129H_2 'Autre betail: 5-9' /QH129H_3 'Autre betail: 10+'. * L'électricité. no2zero QH132A. * Radio. no2zero QH132B. * Télévision. no2zero QH132C. * Une antenne MMDS / TV5. no2zero QH132D. * Un abonnement à canal. no2zero QH132E. * Une Téléphone fixe. no2zero QH132F. * Une machine à laver. no2zero QH132H. * Un Réfrigérateur. no2zero QH132I. * Un rechaud / cuisinière à gaz / éléctrique. no2zero QH132J. * Un foyer amélioré. no2zero QH132K. * Un vidéo / lecteur CD / DVD. no2zero QH132L. * Un climatiseur. no2zero QH132M. * Un Ordinateur. no2zero QH132N. * Internet à la maison. no2zero QH132O. * Une poele à gaz. no2zero QH132P. * Bicyclette. no2zero QH133A. * Mobylette ou Motocyclette ou un scooter. no2zero QH133B. * Voiture personnelle. no2zero QH133C. * Voiture ou camion à titre commercial. no2zero QH133D. * Charrette. no2zero QH133E. * Charrue. no2zero QH133F. * Pirogue / filet de peche. no2zero QH133G. * Tricycle. no2zero QH133H. * Bateau. no2zero QH133I. * Une montre. no2zero QH133K. * Matériau principal du sol. dichotomize (QH152=11) QH152_11 "Matériau principal du sol: Terre/sable". dichotomize (QH152=12) QH152_12 "Matériau principal du sol: Bouse". dichotomize (QH152=21) QH152_21 "Matériau principal du sol: Planches en bois". dichotomize (QH152=22) QH152_22 "Matériau principal du sol: Palmes/bambou". dichotomize (QH152=31) QH152_31 "Matériau principal du sol: Parquet ou bois ciré". dichotomize (QH152=32) QH152_32 "Matériau principal du sol: Bandes de vinyle/asphalte". dichotomize (QH152=33) QH152_33 "Matériau principal du sol: Carrelage". dichotomize (QH152=34) QH152_34 "Matériau principal du sol: Ciment". dichotomize (QH152=35) QH152_35 "Matériau principal du sol: Moquette". dichotomize (QH152=96) QH152_96 "Matériau principal du sol: Autre". * Matériau principal du toit. dichotomize (QH153=11) QH153_11 "Matériau principal du toit: Pas de toit". dichotomize (QH153=12) QH153_12 "Matériau principal du toit: Chaume/palmes/feuilles". dichotomize (QH153=13) QH153_13 "Matériau principal du toit: Mottes de terre". dichotomize (QH153=21) QH153_21 "Matériau principal du toit: Natte". dichotomize (QH153=22) QH153_22 "Matériau principal du toit: Palmes/bambou". dichotomize (QH153=23 | QH153=24) QH153_23 "Matériau principal du toit: Planches en bois, Carton". *ichotomize (QH153=24) QH153_24 "Matériau principal du toit: Carton". dichotomize (QH153=31) QH153_31 "Matériau principal du toit: Tôle". dichotomize (QH153=32) QH153_32 "Matériau principal du toit: Bois". dichotomize (QH153=33) QH153_33 "Matériau principal du toit: Zinc/fibre de ciment". dichotomize (QH153=34) QH153_34 "Matériau principal du toit: Tuiles". dichotomize (QH153=35) QH153_35 "Matériau principal du toit: Ciment". dichotomize (QH153=36) QH153_36 "Matériau principal du toit: Shingles". dichotomize (QH153=96) QH153_96 "Matériau principal du toit: Autre". * Matériau principal des murs extérieurs. dichotomize (QH154=11) QH154_11 "Matériau principal des murs extérieurs: Pas de mur". dichotomize (QH154=12) QH154_12 "Matériau principal des murs extérieurs: Bambou/cane/palme/tronc". dichotomize (QH154=13) QH154_13 "Matériau principal des murs extérieurs: Terre". dichotomize (QH154=21) QH154_21 "Matériau principal des murs extérieurs: Bambou avec boue". dichotomize (QH154=22) QH154_22 "Matériau principal des murs extérieurs: Pierres avec boue". dichotomize (QH154=23) QH154_23 "Matériau principal des murs extérieurs: Adobe non recouvert". dichotomize (QH154=24) QH154_24 "Matériau principal des murs extérieurs: Contre-plaqué". *ichotomize (QH154=25) QH154_25 "Matériau principal des murs extérieurs: Carton". dichotomize (QH154=26) QH154_26 "Matériau principal des murs extérieurs: Bois de récupération". dichotomize (QH154=31) QH154_31 "Matériau principal des murs extérieurs: Ciment". dichotomize (QH154=32) QH154_32 "Matériau principal des murs extérieurs: Pierres avec chaux/ciment". dichotomize (QH154=33) QH154_33 "Matériau principal des murs extérieurs: Briques". dichotomize (QH154=34) QH154_34 "Matériau principal des murs extérieurs: Blocs de ciment". dichotomize (QH154=35) QH154_35 "Matériau principal des murs extérieurs: Adobe recouvert". dichotomize (QH154=36) QH154_36 "Matériau principal des murs extérieurs: Planche en bois/shingles". dichotomize (QH154=96) QH154_96 "Matériau principal des murs extérieurs: Autre". *{Members per sleeping room}. if (hhusual=0) hhusual=hhslept. if (QH127>0) memsleep=trunc(hhusual/QH127). if (QH127=0) memsleep=hhusual. if (missing(QH127) or QH127>=99 or memsleep>=98) memsleep=99. variable labels memsleep 'Number of members per sleeping room'. value labels memsleep 0 'Less than 1 per room'. formats memsleep (f2.0). missing values memsleep (99). * Compute urban and rural variables coded (1/0) for filters later. compute urban=(QHTYPE = 1). compute rural=(QHTYPE = 2). variable labels urban 'Urban' / rural 'Rural'. value labels urban 1 'Urban' / rural 1 'Rural'. formats urban rural (f1.0). execute. * Check on indicator variable creation. frequencies variables=QHTYPE to land. * Toilet facility by shared/not shared. crosstabs /tables=QH109 by QH110. * Land area by units - if there are separate units - need to convert them to one unit. *crosstabs /tables=QH131N by QH131U. * Dropped QH101_96, QH109_15, QH109_15_SH, QH120_11, QH123_1, QH125_3, QH125_6, QH125_7, QH125_8, QH125_12, QH125_15, QH125_16, QH125_17, QH126_5, QH126_7, QH153_24, QH154_25. frequencies variables= QH101A_1 QH101A_2 QH101A_3 QH101A_4 QH101A_5 QH101A_6 QH101A_7 QH101A_8 QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_41 QH101_42 QH101_51 QH101_61 QH101_71 QH101_81 QH101_91 QH101_92 QH109_11 QH109_12 QH109_13 QH109_14 QH109_21 QH109_22 QH109_23 QH109_31 QH109_41 QH109_51 QH109_61 QH109_96 QH109_11_sh QH109_12_sh QH109_13_sh QH109_14_sh QH109_21_sh QH109_22_sh QH109_23_sh QH109_31_sh QH109_51_sh QH109_96_sh QH117_1 QH117_2 QH117_3 QH117_4 QH117_5 QH117_6 QH117_7 QH117_8 QH117_9 QH117_95 QH117_96 QH120_1 QH120_2 QH120_3 QH120_4 QH120_5 QH120_6 QH120_7 QH120_8 QH120_9 QH120_10 QH120_12 QH120_96 QH123_2 QH123_3 QH123_4 QH123_5 QH123_6 QH123_95 QH123_96 QH125_1 QH125_2 QH125_4 QH125_5 QH125_9 QH125_10 QH125_11 QH125_13 QH125_14 QH125_96 QH126_1 QH126_2 QH126_3 QH126_4 QH126_6 QH126_8 QH126_9 QH126_95 QH126_96 QH132A QH132B QH132C QH132D QH132E QH132F QH132H QH132I QH132J QH132K QH132L QH132M QH132N QH132O QH132P QH133A QH133B QH133C QH133D QH133E QH133F QH133G QH133H QH133I QH133K MOBPHONE CHECKACC QH152_11 QH152_12 QH152_21 QH152_22 QH152_31 QH152_32 QH152_33 QH152_34 QH152_35 QH152_96 QH153_11 QH153_12 QH153_13 QH153_21 QH153_22 QH153_23 QH153_31 QH153_32 QH153_33 QH153_34 QH153_35 QH153_36 QH153_96 QH154_11 QH154_12 QH154_13 QH154_21 QH154_22 QH154_23 QH154_24 QH154_26 QH154_31 QH154_32 QH154_33 QH154_34 QH154_35 QH154_36 QH154_96 HOUSE LAND memsleep QH129A_1 QH129A_2 QH129A_3 QH129B_1 QH129C_1 QH129C_2 QH129C_3 QH129D_1 QH129D_2 QH129D_3 QH129E_1 QH129E_2 QH129E_3 QH129F_1 QH129F_2 QH129F_3 QH129G_1 QH129G_2 QH129G_3 QH129H_1 QH129H_2 QH129H_3 . * Turn off weights before all factor analysis. weight off. * Name the dataset window for the HH data for use later. dataset name assets. save outfile='assets.sav'. *** Test Factor Analysis. filter off. execute. factor /variables QH101A_1 QH101A_2 QH101A_3 QH101A_4 QH101A_5 QH101A_6 QH101A_7 QH101A_8 QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_41 QH101_42 QH101_51 QH101_61 QH101_71 QH101_81 QH101_91 QH101_92 QH109_11 QH109_12 QH109_13 QH109_14 QH109_21 QH109_22 QH109_23 QH109_31 QH109_41 QH109_51 QH109_61 QH109_96 QH109_11_sh QH109_12_sh QH109_13_sh QH109_14_sh QH109_21_sh QH109_22_sh QH109_23_sh QH109_31_sh QH109_51_sh QH109_96_sh QH117_1 QH117_2 QH117_3 QH117_4 QH117_5 QH117_6 QH117_7 QH117_8 QH117_9 QH117_95 QH117_96 QH120_1 QH120_2 QH120_3 QH120_4 QH120_5 QH120_6 QH120_7 QH120_8 QH120_9 QH120_10 QH120_12 QH120_96 QH123_2 QH123_3 QH123_4 QH123_5 QH123_6 QH123_95 QH123_96 QH125_1 QH125_2 QH125_4 QH125_5 QH125_9 QH125_10 QH125_11 QH125_13 QH125_14 QH125_96 QH126_1 QH126_2 QH126_3 QH126_4 QH126_6 QH126_8 QH126_9 QH126_95 QH126_96 QH132A QH132B QH132C QH132D QH132E QH132F QH132H QH132I QH132J QH132K QH132L QH132M QH132N QH132O QH132P QH133A QH133B QH133C QH133D QH133E QH133F QH133G QH133H QH133I QH133K MOBPHONE CHECKACC QH152_11 QH152_12 QH152_21 QH152_22 QH152_31 QH152_32 QH152_33 QH152_34 QH152_35 QH152_96 QH153_11 QH153_12 QH153_13 QH153_21 QH153_22 QH153_23 QH153_31 QH153_32 QH153_33 QH153_34 QH153_35 QH153_36 QH153_96 QH154_11 QH154_12 QH154_13 QH154_21 QH154_22 QH154_23 QH154_24 QH154_26 QH154_31 QH154_32 QH154_33 QH154_34 QH154_35 QH154_36 QH154_96 HOUSE LAND memsleep QH129A_1 QH129A_2 QH129A_3 QH129B_1 QH129C_1 QH129C_2 QH129C_3 QH129D_1 QH129D_2 QH129D_3 QH129E_1 QH129E_2 QH129E_3 QH129F_1 QH129F_2 QH129F_3 QH129G_1 QH129G_2 QH129G_3 QH129H_1 QH129H_2 QH129H_3 /missing meansub /analysis QH101A_1 QH101A_2 QH101A_3 QH101A_4 QH101A_5 QH101A_6 QH101A_7 QH101A_8 QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_41 QH101_42 QH101_51 QH101_61 QH101_71 QH101_81 QH101_91 QH101_92 QH109_11 QH109_12 QH109_13 QH109_14 QH109_21 QH109_22 QH109_23 QH109_31 QH109_41 QH109_51 QH109_61 QH109_96 QH109_11_sh QH109_12_sh QH109_13_sh QH109_14_sh QH109_21_sh QH109_22_sh QH109_23_sh QH109_31_sh QH109_51_sh QH109_96_sh QH117_1 QH117_2 QH117_3 QH117_4 QH117_5 QH117_6 QH117_7 QH117_8 QH117_9 QH117_95 QH117_96 QH120_1 QH120_2 QH120_3 QH120_4 QH120_5 QH120_6 QH120_7 QH120_8 QH120_9 QH120_10 QH120_12 QH120_96 QH123_2 QH123_3 QH123_4 QH123_5 QH123_6 QH123_95 QH123_96 QH125_1 QH125_2 QH125_4 QH125_5 QH125_9 QH125_10 QH125_11 QH125_13 QH125_14 QH125_96 QH126_1 QH126_2 QH126_3 QH126_4 QH126_6 QH126_8 QH126_9 QH126_95 QH126_96 QH132A QH132B QH132C QH132D QH132E QH132F QH132H QH132I QH132J QH132K QH132L QH132M QH132N QH132O QH132P QH133A QH133B QH133C QH133D QH133E QH133F QH133G QH133H QH133I QH133K MOBPHONE CHECKACC QH152_11 QH152_12 QH152_21 QH152_22 QH152_31 QH152_32 QH152_33 QH152_34 QH152_35 QH152_96 QH153_11 QH153_12 QH153_13 QH153_21 QH153_22 QH153_23 QH153_31 QH153_32 QH153_33 QH153_34 QH153_35 QH153_36 QH153_96 QH154_11 QH154_12 QH154_13 QH154_21 QH154_22 QH154_23 QH154_24 QH154_26 QH154_31 QH154_32 QH154_33 QH154_34 QH154_35 QH154_36 QH154_96 HOUSE LAND memsleep QH129A_1 QH129A_2 QH129A_3 QH129B_1 QH129C_1 QH129C_2 QH129C_3 QH129D_1 QH129D_2 QH129D_3 QH129E_1 QH129E_2 QH129E_3 QH129F_1 QH129F_2 QH129F_3 QH129G_1 QH129G_2 QH129G_3 QH129H_1 QH129H_2 QH129H_3 /print univariate initial extraction fscore /criteria factors(1) iterate(25) /extraction pc /rotation norotate /method=correlation. *** Common Factor analysis ***. ** Removed area-specific variables **. ** Agricultural animal variables excluded ** Land area excluded *** Common Factor Analysis. filter off. execute. factor /variables QH101A_1 QH101A_2 QH101A_3 QH101A_4 QH101A_5 QH101A_6 QH101A_7 QH101A_8 QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_41 QH101_42 QH101_51 QH101_61 QH101_71 QH101_81 QH101_91 QH101_92 QH109_11 QH109_12 QH109_13 QH109_14 QH109_21 QH109_22 QH109_23 QH109_31 QH109_41 QH109_51 QH109_61 QH109_96 QH109_11_sh QH109_12_sh QH109_13_sh QH109_14_sh QH109_21_sh QH109_22_sh QH109_23_sh QH109_31_sh QH109_51_sh QH109_96_sh QH117_1 QH117_2 QH117_3 QH117_4 QH117_5 QH117_6 QH117_7 QH117_8 QH117_9 QH117_95 QH117_96 QH120_1 QH120_2 QH120_3 QH120_4 QH120_5 QH120_6 QH120_7 QH120_8 QH120_9 QH120_10 QH120_12 QH120_96 QH123_2 QH123_3 QH123_4 QH123_5 QH123_6 QH123_95 QH123_96 QH125_1 QH125_2 QH125_4 QH125_5 QH125_9 QH125_10 QH125_11 QH125_13 QH125_14 QH125_96 QH126_1 QH126_2 QH126_3 QH126_4 QH126_6 QH126_8 QH126_9 QH126_95 QH126_96 QH132A QH132B QH132C QH132D QH132E QH132F QH132H QH132I QH132J QH132K QH132L QH132M QH132N QH132O QH132P QH133A QH133B QH133C QH133D QH133E QH133F QH133G QH133H QH133I QH133K MOBPHONE CHECKACC QH152_11 QH152_12 QH152_21 QH152_22 QH152_31 QH152_32 QH152_33 QH152_34 QH152_35 QH152_96 QH153_11 QH153_12 QH153_13 QH153_21 QH153_22 QH153_23 QH153_31 QH153_32 QH153_33 QH153_34 QH153_35 QH153_36 QH153_96 QH154_11 QH154_12 QH154_13 QH154_21 QH154_22 QH154_23 QH154_24 QH154_26 QH154_31 QH154_32 QH154_33 QH154_34 QH154_35 QH154_36 QH154_96 HOUSE LAND memsleep /missing meansub /analysis QH101A_1 QH101A_2 QH101A_3 QH101A_4 QH101A_5 QH101A_6 QH101A_7 QH101A_8 QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_41 QH101_42 QH101_51 QH101_61 QH101_71 QH101_81 QH101_91 QH101_92 QH109_11 QH109_12 QH109_13 QH109_14 QH109_21 QH109_22 QH109_23 QH109_31 QH109_41 QH109_51 QH109_61 QH109_96 QH109_11_sh QH109_12_sh QH109_13_sh QH109_14_sh QH109_21_sh QH109_22_sh QH109_23_sh QH109_31_sh QH109_51_sh QH109_96_sh QH117_1 QH117_2 QH117_3 QH117_4 QH117_5 QH117_6 QH117_7 QH117_8 QH117_9 QH117_95 QH117_96 QH120_1 QH120_2 QH120_3 QH120_4 QH120_5 QH120_6 QH120_7 QH120_8 QH120_9 QH120_10 QH120_12 QH120_96 QH123_2 QH123_3 QH123_4 QH123_5 QH123_6 QH123_95 QH123_96 QH125_1 QH125_2 QH125_4 QH125_5 QH125_9 QH125_10 QH125_11 QH125_13 QH125_14 QH125_96 QH126_1 QH126_2 QH126_3 QH126_4 QH126_6 QH126_8 QH126_9 QH126_95 QH126_96 QH132A QH132B QH132C QH132D QH132E QH132F QH132H QH132I QH132J QH132K QH132L QH132M QH132N QH132O QH132P QH133A QH133B QH133C QH133D QH133E QH133F QH133G QH133H QH133I QH133K MOBPHONE CHECKACC QH152_11 QH152_12 QH152_21 QH152_22 QH152_31 QH152_32 QH152_33 QH152_34 QH152_35 QH152_96 QH153_11 QH153_12 QH153_13 QH153_21 QH153_22 QH153_23 QH153_31 QH153_32 QH153_33 QH153_34 QH153_35 QH153_36 QH153_96 QH154_11 QH154_12 QH154_13 QH154_21 QH154_22 QH154_23 QH154_24 QH154_26 QH154_31 QH154_32 QH154_33 QH154_34 QH154_35 QH154_36 QH154_96 HOUSE LAND memsleep /print univariate initial extraction fscore /criteria factors(1) iterate(25) /extraction pc /rotation norotate /save reg(ALL com) /method=correlation. *** Urban Factor Analysis. filter off. filter by urban. execute. * Dropped from Urban PCA. * . * QH19001_81, QH109_41, QH120_8, QH125_14. factor /variables QH101A_1 QH101A_2 QH101A_3 QH101A_4 QH101A_5 QH101A_6 QH101A_7 QH101A_8 QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_41 QH101_42 QH101_51 QH101_61 QH101_71 QH101_91 QH101_92 QH109_11 QH109_12 QH109_13 QH109_14 QH109_21 QH109_22 QH109_23 QH109_31 QH109_51 QH109_61 QH109_96 QH109_11_sh QH109_12_sh QH109_13_sh QH109_14_sh QH109_21_sh QH109_22_sh QH109_23_sh QH109_31_sh QH109_51_sh QH109_96_sh QH117_1 QH117_2 QH117_3 QH117_4 QH117_5 QH117_6 QH117_7 QH117_8 QH117_9 QH117_95 QH117_96 QH120_1 QH120_2 QH120_3 QH120_4 QH120_5 QH120_6 QH120_7 QH120_9 QH120_10 QH120_12 QH120_96 QH123_2 QH123_3 QH123_4 QH123_5 QH123_6 QH123_95 QH123_96 QH125_1 QH125_2 QH125_4 QH125_5 QH125_9 QH125_10 QH125_11 QH125_13 QH125_96 QH126_1 QH126_2 QH126_3 QH126_4 QH126_6 QH126_8 QH126_9 QH126_95 QH126_96 QH132A QH132B QH132C QH132D QH132E QH132F QH132H QH132I QH132J QH132K QH132L QH132M QH132N QH132O QH132P QH133A QH133B QH133C QH133D QH133E QH133F QH133G QH133H QH133I QH133K MOBPHONE CHECKACC QH152_11 QH152_12 QH152_21 QH152_22 QH152_31 QH152_32 QH152_33 QH152_34 QH152_35 QH152_96 QH153_11 QH153_12 QH153_13 QH153_21 QH153_22 QH153_23 QH153_31 QH153_32 QH153_33 QH153_34 QH153_35 QH153_36 QH153_96 QH154_11 QH154_12 QH154_13 QH154_21 QH154_22 QH154_23 QH154_24 QH154_26 QH154_31 QH154_32 QH154_33 QH154_34 QH154_35 QH154_36 QH154_96 HOUSE LAND memsleep /missing meansub /analysis QH101A_1 QH101A_2 QH101A_3 QH101A_4 QH101A_5 QH101A_6 QH101A_7 QH101A_8 QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_41 QH101_42 QH101_51 QH101_61 QH101_71 QH101_91 QH101_92 QH109_11 QH109_12 QH109_13 QH109_14 QH109_21 QH109_22 QH109_23 QH109_31 QH109_51 QH109_61 QH109_96 QH109_11_sh QH109_12_sh QH109_13_sh QH109_14_sh QH109_21_sh QH109_22_sh QH109_23_sh QH109_31_sh QH109_51_sh QH109_96_sh QH117_1 QH117_2 QH117_3 QH117_4 QH117_5 QH117_6 QH117_7 QH117_8 QH117_9 QH117_95 QH117_96 QH120_1 QH120_2 QH120_3 QH120_4 QH120_5 QH120_6 QH120_7 QH120_9 QH120_10 QH120_12 QH120_96 QH123_2 QH123_3 QH123_4 QH123_5 QH123_6 QH123_95 QH123_96 QH125_1 QH125_2 QH125_4 QH125_5 QH125_9 QH125_10 QH125_11 QH125_13 QH125_96 QH126_1 QH126_2 QH126_3 QH126_4 QH126_6 QH126_8 QH126_9 QH126_95 QH126_96 QH132A QH132B QH132C QH132D QH132E QH132F QH132H QH132I QH132J QH132K QH132L QH132M QH132N QH132O QH132P QH133A QH133B QH133C QH133D QH133E QH133F QH133G QH133H QH133I QH133K MOBPHONE CHECKACC QH152_11 QH152_12 QH152_21 QH152_22 QH152_31 QH152_32 QH152_33 QH152_34 QH152_35 QH152_96 QH153_11 QH153_12 QH153_13 QH153_21 QH153_22 QH153_23 QH153_31 QH153_32 QH153_33 QH153_34 QH153_35 QH153_36 QH153_96 QH154_11 QH154_12 QH154_13 QH154_21 QH154_22 QH154_23 QH154_24 QH154_26 QH154_31 QH154_32 QH154_33 QH154_34 QH154_35 QH154_36 QH154_96 HOUSE LAND memsleep /print univariate initial extraction fscore /criteria factors(1) iterate(25) /extraction pc /rotation norotate /save reg(ALL urb) /method=correlation. *** Rural Factor Analysis. filter off. filter by rural. execute. * Dropped QH117_2, QH120_1, QH120_2, QH125_2, QH125_5. factor /variables QH101A_1 QH101A_2 QH101A_3 QH101A_4 QH101A_5 QH101A_6 QH101A_7 QH101A_8 QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_41 QH101_42 QH101_51 QH101_61 QH101_71 QH101_81 QH101_91 QH101_92 QH109_11 QH109_12 QH109_13 QH109_14 QH109_21 QH109_22 QH109_23 QH109_31 QH109_41 QH109_51 QH109_61 QH109_96 QH109_11_sh QH109_12_sh QH109_13_sh QH109_14_sh QH109_21_sh QH109_22_sh QH109_23_sh QH109_31_sh QH109_51_sh QH109_96_sh QH117_1 QH117_3 QH117_4 QH117_5 QH117_6 QH117_7 QH117_8 QH117_9 QH117_95 QH117_96 QH120_3 QH120_4 QH120_5 QH120_6 QH120_7 QH120_8 QH120_9 QH120_10 QH120_12 QH120_96 QH123_2 QH123_3 QH123_4 QH123_5 QH123_6 QH123_95 QH123_96 QH125_1 QH125_4 QH125_9 QH125_10 QH125_11 QH125_13 QH125_14 QH125_96 QH126_1 QH126_2 QH126_3 QH126_4 QH126_6 QH126_8 QH126_9 QH126_95 QH126_96 QH132A QH132B QH132C QH132D QH132E QH132F QH132H QH132I QH132J QH132K QH132L QH132M QH132N QH132O QH132P QH133A QH133B QH133C QH133D QH133E QH133F QH133G QH133H QH133I QH133K MOBPHONE CHECKACC QH152_11 QH152_12 QH152_21 QH152_22 QH152_31 QH152_32 QH152_33 QH152_34 QH152_35 QH152_96 QH153_11 QH153_12 QH153_13 QH153_21 QH153_22 QH153_23 QH153_31 QH153_32 QH153_33 QH153_34 QH153_35 QH153_36 QH153_96 QH154_11 QH154_12 QH154_13 QH154_21 QH154_22 QH154_23 QH154_24 QH154_26 QH154_31 QH154_32 QH154_33 QH154_34 QH154_35 QH154_36 QH154_96 HOUSE LAND memsleep QH129A_1 QH129A_2 QH129A_3 QH129B_1 QH129C_1 QH129C_2 QH129C_3 QH129D_1 QH129D_2 QH129D_3 QH129E_1 QH129E_2 QH129E_3 QH129F_1 QH129F_2 QH129F_3 QH129G_1 QH129G_2 QH129G_3 QH129H_1 QH129H_2 QH129H_3 /missing meansub /analysis QH101A_1 QH101A_2 QH101A_3 QH101A_4 QH101A_5 QH101A_6 QH101A_7 QH101A_8 QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_41 QH101_42 QH101_51 QH101_61 QH101_71 QH101_81 QH101_91 QH101_92 QH109_11 QH109_12 QH109_13 QH109_14 QH109_21 QH109_22 QH109_23 QH109_31 QH109_41 QH109_51 QH109_61 QH109_96 QH109_11_sh QH109_12_sh QH109_13_sh QH109_14_sh QH109_21_sh QH109_22_sh QH109_23_sh QH109_31_sh QH109_51_sh QH109_96_sh QH117_1 QH117_3 QH117_4 QH117_5 QH117_6 QH117_7 QH117_8 QH117_9 QH117_95 QH117_96 QH120_3 QH120_4 QH120_5 QH120_6 QH120_7 QH120_8 QH120_9 QH120_10 QH120_12 QH120_96 QH123_2 QH123_3 QH123_4 QH123_5 QH123_6 QH123_95 QH123_96 QH125_1 QH125_4 QH125_9 QH125_10 QH125_11 QH125_13 QH125_14 QH125_96 QH126_1 QH126_2 QH126_3 QH126_4 QH126_6 QH126_8 QH126_9 QH126_95 QH126_96 QH132A QH132B QH132C QH132D QH132E QH132F QH132H QH132I QH132J QH132K QH132L QH132M QH132N QH132O QH132P QH133A QH133B QH133C QH133D QH133E QH133F QH133G QH133H QH133I QH133K MOBPHONE CHECKACC QH152_11 QH152_12 QH152_21 QH152_22 QH152_31 QH152_32 QH152_33 QH152_34 QH152_35 QH152_96 QH153_11 QH153_12 QH153_13 QH153_21 QH153_22 QH153_23 QH153_31 QH153_32 QH153_33 QH153_34 QH153_35 QH153_36 QH153_96 QH154_11 QH154_12 QH154_13 QH154_21 QH154_22 QH154_23 QH154_24 QH154_26 QH154_31 QH154_32 QH154_33 QH154_34 QH154_35 QH154_36 QH154_96 HOUSE LAND memsleep QH129A_1 QH129A_2 QH129A_3 QH129B_1 QH129C_1 QH129C_2 QH129C_3 QH129D_1 QH129D_2 QH129D_3 QH129E_1 QH129E_2 QH129E_3 QH129F_1 QH129F_2 QH129F_3 QH129G_1 QH129G_2 QH129G_3 QH129H_1 QH129H_2 QH129H_3 /print univariate initial extraction fscore /criteria factors(1) iterate(25) /extraction pc /rotation norotate /save reg(ALL rur) /method=correlation. * Label the created score variables. rename variables (com1 urb1 rur1=comscore urbscore rurscore). variable labels comscore 'Common wealth score' /urbscore 'Urban wealth score' /rurscore 'Rural wealth score'. * Add a variable used for linking later. filter off. string rowtype_ (A8). compute rowtype_ = 'EST'. * Calculate regressions. ** Area=urban. filter off. filter by urban. execute. * Declare a dataset to be written to in the regression. dataset declare urbancorv. * Run regression of comscore with urbscore. regression /missing listwise /statistics coeff outs R anova /criteria=pin(.05) pout(.10) /noorigin /dependent comscore /method=enter urbscore /outfile=corv(urbancorv). * Activate file of output from regression. dataset activate urbancorv. * Drop all rows of output except the coefficients. select if (rowtype_ = 'EST'). execute. * Delete unnecessary variables before merging. delete variables DEPVAR_ VARNAME_. * Rename variables containing the constant and the coefficient. rename variables CONST_=urbconst urbscore=urbcoeff. * Re-activate the main household data. dataset activate assets. * merge the coefficients. match files /file = * /table = urbancorv /by ROWTYPE_. execute. * Calculate regressions. ** Area=rural. filter off. filter by rural. execute. * Declare a dataset to be written to in the regression. dataset declare ruralcorv. * Run regression of comscore with rurscore. regression /missing listwise /statistics coeff outs R anova /criteria=pin(.05) pout(.10) /noorigin /dependent comscore /method=enter rurscore /outfile=corv(ruralcorv). * Activate file of output from regression. dataset activate ruralcorv. * Drop all rows of output except the coefficients. select if (rowtype_ = 'EST'). execute. * Delete unnecessary variables before merging. delete variables DEPVAR_ VARNAME_. * Rename variables containing the constant and the coefficient. rename variables CONST_=rurconst rurscore=rurcoeff. * Re-activate the main household data. dataset activate assets. * merge the coefficients. match files /file = * /table = ruralcorv /by ROWTYPE_. execute. dataset close urbancorv. dataset close ruralcorv. dataset activate assets. filter off. *** Calculate combined wealth score from Urban and Rural Scores. * Use coefficients from urban and rural regressions above. compute combscor=0. print formats combscor (f11.5). write formats combscor (f11.5). ** Urban. if (urban = 1) combscor=urbconst+urbcoeff*urbscore. ** Rural. if (rural = 1) combscor=rurconst+rurcoeff*rurscore. variable labels combscor 'Combined national wealth score'. execute. compute hhwt = QHWEIGHT/1000000. variable labels hhwt 'HH weights'. formats hhwt (f12.6). weight by hhwt. filter off. execute. frequencies variables=combscor comscore /format=notable /ntiles=5 /statistics=minimum maximum stddev mean /histogram normal /order=analysis. filter off. filter by urban. execute. frequencies variables=combscor urbscore /format=notable /ntiles=5 /statistics=minimum maximum stddev mean /histogram normal /order=analysis. filter off. filter by rural. execute. frequencies variables=combscor rurscore /format=notable /ntiles=5 /statistics=minimum maximum stddev mean /histogram normal /order=analysis. filter off. execute. *Calculate quintiles and scores for data file. compute hhmemwt=QHWEIGHT*hhusual/1000000. variable labels hhmemwt 'HH members weighting for index'. formats hhmemwt (f12.6). weight by hhmemwt. filter off. filter by urban. execute. rank variables=urbscore (A) /rank /ntiles (5) /print=yes /ties=mean. filter off. filter by rural. execute. rank variables=rurscore (A) /rank /ntiles (5) /print=yes /ties=mean. filter off. execute. rank variables=combscor (A) /rank /ntiles (5) /print=yes /ties=mean. variable labels ncombsco 'Combined wealth index' /nurbscor 'Urban wealth index' /nrurscor 'Rural wealth index'. value labels ncombsco nurbscor nrurscor 1 'Lowest' 2 'Second' 3 'Middle' 4 'Fourth' 5 'Highest'. *** Check on quintiles. frequencies variables=ncombsco nurbscor nrurscor. weight by hhwt. ctables /table ( QH101A_1+QH101A_2+QH101A_3+QH101A_4+QH101A_5+QH101A_6+QH101A_7+QH101A_8+ QH101_11+QH101_12+QH101_13+QH101_14+QH101_21+QH101_31+QH101_32+QH101_41+QH101_42+QH101_51+QH101_61+QH101_71+QH101_81+QH101_91+QH101_92+ QH109_11+QH109_12+QH109_13+QH109_14+QH109_21+QH109_22+QH109_23+QH109_31+QH109_41+QH109_51+QH109_61+QH109_96+ QH109_11_sh+QH109_12_sh+QH109_13_sh+QH109_14_sh+QH109_21_sh+QH109_22_sh+QH109_23_sh+QH109_31_sh+QH109_51_sh+QH109_96_sh+ QH117_1+QH117_2+QH117_3+QH117_4+QH117_5+QH117_6+QH117_7+QH117_8+QH117_9+QH117_95+QH117_96+ QH120_1+QH120_2+QH120_3+QH120_4+QH120_5+QH120_6+QH120_7+QH120_8+QH120_9+QH120_10+QH120_12+QH120_96+ QH123_2+QH123_3+QH123_4+QH123_5+QH123_6+QH123_95+QH123_96+ QH125_1+QH125_2+QH125_4+QH125_5+QH125_9+QH125_10+QH125_11+QH125_13+QH125_14+QH125_96+ QH126_1+QH126_2+QH126_3+QH126_4+QH126_6+QH126_8+QH126_9+QH126_95+QH126_96+ QH132A+QH132B+QH132C+QH132D+QH132E+QH132F+QH132H+QH132I+QH132J+QH132K+QH132L+QH132M+QH132N+QH132O+QH132P+QH133A+QH133B+QH133C+QH133D+QH133E+QH133F+QH133G+ QH133H+QH133I+QH133K+MOBPHONE+CHECKACC+ QH152_11+QH152_12+QH152_21+QH152_22+QH152_31+QH152_32+QH152_33+QH152_34+QH152_35+QH152_96+ QH153_11+QH153_12+QH153_13+QH153_21+QH153_22+QH153_23+QH153_31+QH153_32+QH153_33+QH153_34+QH153_35+QH153_36+QH153_96+ QH154_11+QH154_12+QH154_13+QH154_21+QH154_22+QH154_23+QH154_24+QH154_26+QH154_31+QH154_32+QH154_33+QH154_34+QH154_35+QH154_36+QH154_96+ HOUSE+LAND+memsleep+ QH129A_1+QH129A_2+QH129A_3+QH129B_1+ QH129C_1+QH129C_2+QH129C_3+QH129D_1+QH129D_2+QH129D_3+ QH129E_1+QH129E_2+QH129E_3+QH129F_1+QH129F_2+QH129F_3+ QH129G_1+QH129G_2+QH129G_3+QH129H_1+QH129H_2+QH129H_3 )[S][Mean F8.3] by (ncombsco+nurbscor+nrurscor)[C] /slabels visible=no. * Alternative instead of ctables. *means tables= QH101A_1 QH101A_2 QH101A_3 QH101A_4 QH101A_5 QH101A_6 QH101A_7 QH101A_8 QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_41 QH101_42 QH101_51 QH101_61 QH101_71 QH101_81 QH101_91 QH101_92 QH109_11 QH109_12 QH109_13 QH109_14 QH109_21 QH109_22 QH109_23 QH109_31 QH109_41 QH109_51 QH109_61 QH109_96 QH109_11_sh QH109_12_sh QH109_13_sh QH109_14_sh QH109_21_sh QH109_22_sh QH109_23_sh QH109_31_sh QH109_51_sh QH109_96_sh QH117_1 QH117_2 QH117_3 QH117_4 QH117_5 QH117_6 QH117_7 QH117_8 QH117_9 QH117_95 QH117_96 QH120_1 QH120_2 QH120_3 QH120_4 QH120_5 QH120_6 QH120_7 QH120_8 QH120_9 QH120_10 QH120_12 QH120_96 QH123_2 QH123_3 QH123_4 QH123_5 QH123_6 QH123_95 QH123_96 QH125_1 QH125_2 QH125_4 QH125_5 QH125_9 QH125_10 QH125_11 QH125_13 QH125_14 QH125_96 QH126_1 QH126_2 QH126_3 QH126_4 QH126_6 QH126_8 QH126_9 QH126_95 QH126_96 QH132A QH132B QH132C QH132D QH132E QH132F QH132H QH132I QH132J QH132K QH132L QH132M QH132N QH132O QH132P QH133A QH133B QH133C QH133D QH133E QH133F QH133G QH133H QH133I QH133K MOBPHONE CHECKACC QH152_11 QH152_12 QH152_21 QH152_22 QH152_31 QH152_32 QH152_33 QH152_34 QH152_35 QH152_96 QH153_11 QH153_12 QH153_13 QH153_21 QH153_22 QH153_23 QH153_31 QH153_32 QH153_33 QH153_34 QH153_35 QH153_36 QH153_96 QH154_11 QH154_12 QH154_13 QH154_21 QH154_22 QH154_23 QH154_24 QH154_26 QH154_31 QH154_32 QH154_33 QH154_34 QH154_35 QH154_36 QH154_96 HOUSE LAND memsleep QH129A_1 QH129A_2 QH129A_3 QH129B_1 QH129C_1 QH129C_2 QH129C_3 QH129D_1 QH129D_2 QH129D_3 QH129E_1 QH129E_2 QH129E_3 QH129F_1 QH129F_2 QH129F_3 QH129G_1 QH129G_2 QH129G_3 QH129H_1 QH129H_2 QH129H_3 by ncombsco nurbscor nrurscor /cells mean count stddev. graph /histogram(normal)=combscor /title= 'Distribution of Households by Wealth Scores'. frequencies variables=combscor /format=notable /ntiles=5 /statistics=stddev minimum maximum semean mean median mode skewness seskew kurtosis sekurt /order=analysis. weight off. filter off. write formats combscor urbscore rurscore (f11.5). * Save final dataset of assets. save outfile='assets.sav'. *** Write out scores file. write outfile='scores.dat' table /QHCLUST QHNUMBER combscor ncombsco urbscore nurbscor rurscore nrurscor. execute. * Produce table 2.6 weighted by de jure population to test. weight by hhmemwt. compute total = 0. variable labels total 'Total'. value labels total 0 ' '. ctables /vlabels variables=QHTYPE QHREGION total Ncombsco display=both /table QHTYPE [C] + QHREGION [C] + total [C] BY Ncombsco [C][rowpct.count '%' F8.1, totals [rowpct.count '%' F8.1, count '' F8.0]] /categories variables=Ncombsco total=yes /titles title='Table 2.6 Wealth Quintiles' '' 'Percent distribution of the de jure population by wealth quintiles, according to residence and region, Sengal DHS 2022-23' corner='Residence/region' /slabels visible=no.